//引用Vuex
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

//实例store对象
const store = new Vuex.Store({
	state: {
		userInfo: {}, //登录成功后保存的个人信息
		ContentHeight: '', //可视区域的高度
		targetIndustry: '12', //目标行业
		region: '济南市', //目标城市,
		webIframSearch: '',  //全部搜索 输入的关键字
	},
	mutations: {
		//登录成功后保存的个人信息
		getUserInfo(state, params) {
			state.userInfo = params;
		},
		//可是区域的高度
		setContentHeight(state, params) {
			state.ContentHeight = params;
		},
		//设置选中的 目标行业
		setTargetIndustry(state, params) {
			state.targetIndustry = params;
		},
		setRegion(state, params) {
			state.region = params;
		},
		//设置全部搜索 输入的关键字
		setwebIframSearch(state, params) {
			state.webIframSearch = params;
		}
	}
})

//导出store对象
export default store
//export default const store或者export const store会报错